var col1H = 0;
var col2H = 0;
var col1 = [];
var col2 = [];
var loadOver = true;
var loadOveropen;
var app = getApp()
Page({
  data: {
    goodsByKey: "",
    keyword: "",
    imagesList: [],
    scrollH: 1500,
    loadText: '上拉加载更多',
    curpage: 0,
    images: {},
    
  },
  onLoad: function () {
    wx.setNavigationBarTitle({
      title: '查询'
    })
  },
  onShow: function () {
    col1 = [];
    col2 = [];
    loadOver = true;
    loadOveropen = true;
  },
  houduanTab_input: function (e) {
    this.setData({
      keyword: e.detail.value
    })
  },
  houduanButton: function () {
    var that = this;
    wx.request({
      url: app.globalData.url + 'searchGoodByKeyAction',
      data: {
        key: that.data.keyword
      },
      method: 'GET',
      header: {
        'content-type': 'application/x-www-form-urlencoded;charset=utf-8',
      },
      success: function (res) {
        // console.log(res.data)//打印到控制台 
        if (res.data == null) {
          var toastText = '无相关数据';
          wx.showToast({
            title: toastText,
            icon: '',
            duration: 2000
          });
        } else {
          that.setData({
            goodsByKey: JSON.stringify(res.data)
          })
          
          wx.redirectTo({
            
            url: '../goodsByKey/goodsByKey?goodsByKey='+that.data.goodsByKey,
          })
        }
      }
    })
  },

  
})